home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / mflms101.arc / MFL_QREF.DOC < prev    next >
Text File  |  1989-11-25  |  26KB  |  948 lines

  1.  
  2.              MICROFIRM FUNCTION LIBRARY QUICK REFERENCE GUIDE
  3.  
  4.             Copyright 1988-89 by Robert B. Stout dba MicroFirm
  5.  
  6.  
  7. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  8. *  MFLFILES.H                                                          *
  9. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  10.  
  11.  
  12. **********************************************************
  13. *  Check for the existance of a file                     *
  14. **********************************************************
  15.  
  16. int exists(char *);
  17. See if a file exists
  18.              
  19. **********************************************************
  20. *  Change/verify disk drives or directories              *
  21. **********************************************************
  22.  
  23. int chdrv(char);
  24. Change disk drives
  25.  
  26. LOGICAL drvalid(char);
  27. See if a drive is valid
  28.  
  29. char getdrv(void);
  30. Return default drive
  31.  
  32. int pushdir(char *);
  33. Save current directory, then go to a new one
  34.  
  35. int popdir(void);
  36. Return to previous directory
  37.  
  38. **********************************************************
  39. *  File operations using FCB functions                   *
  40. **********************************************************
  41.  
  42. int FCB_creat(char *, int);
  43. Create a file using a file control block
  44.  
  45. int FCB_kill(char *, int);
  46. Delete a file using a file control block
  47.  
  48. struct XFCB *  FCB_open(char *, int);
  49. Open a file using a file control block
  50.  
  51. int FCB_close(struct XFCB *);
  52. Close a file using a file control block
  53.  
  54. int FCB_reads(struct XFCB *, void *);
  55. Sequential read using a file control block
  56.  
  57. int FCB_writes(struct XFCB *, void *);
  58. Sequential write using a file control block
  59.  
  60. int FCB_readr(struct XFCB *, void *, long);
  61. Random read using a file control block
  62.  
  63. int FCB_writer(struct XFCB *, void *, long);
  64. Random write using a file control block
  65.  
  66. **********************************************************
  67. *  Manipulate volume labels                              *
  68. **********************************************************
  69.  
  70. char *flretvol(char);
  71. Return volume label for a specified drive
  72.  
  73. int flremvol(char);
  74. Remove volume label for a specified drive
  75.  
  76. int flsetvol(char, char *);
  77. Set volume label for a specified drive
  78.  
  79. **********************************************************
  80. *  Delete files using FCB's - very fast with wildcards!  *
  81. **********************************************************
  82.  
  83. int del_files(char *, char *);
  84. Delete all files matching a spec in a given directory
  85.  
  86. **********************************************************
  87. *  Copy files                                            *
  88. **********************************************************
  89.  
  90. int fcopy(char *, char *, int);
  91. Copy one file to another with overwrite control
  92.  
  93. **********************************************************
  94. *  Expand command line wildcard arguments                *
  95. **********************************************************
  96.  
  97. extern char **nargv;
  98. int expand_args(int, char *[]);
  99. Expand command line arguments
  100.  
  101. **********************************************************
  102. *  Directory operations using file-type functions        *
  103. **********************************************************
  104.  
  105. DOS_DIR * opendir(char *);
  106. Open a directory for reading
  107.  
  108. void closedir(DOS_DIR *);
  109. Close a directory
  110.  
  111. struct FIND * readdir(DOS_DIR *);
  112. Read directory entries
  113.  
  114. int dirmask(struct FIND *, char *, char *, unsigned, unsigned);
  115. Validates directory entries based on name and attributes
  116.  
  117. **********************************************************
  118. *  Stream functions for installable stream filters.      *
  119. **********************************************************
  120.  
  121. SFILE * sfopen(char *, char *);
  122. Open a file as a filterable stream
  123.  
  124. SFILE * scopen(int (*)(), int (*)(), char *);
  125. Open a channel as a filterable stream
  126.  
  127. int sfclose(SFILE *);
  128. Close an open stream
  129.  
  130. int sfputc(int, SFILE *);
  131. Put a character to a stream
  132.  
  133. int sfputs(char *, SFILE *);
  134. Put a string to a stream
  135.  
  136. size_t sfwrite(void *, size_t, size_t, SFILE *);
  137. Write a buffer to a stream
  138.  
  139. int sfgetc(SFILE *);
  140. Get a character from a stream
  141.  
  142. char  * sfgets(void *, int, SFILE *);
  143. Get a string from a stream
  144.  
  145. size_t sfread(void *, size_t, size_t, SFILE *);
  146. Read a buffer from a stream
  147.  
  148. LOGICAL sfinstall(SFILE *, SFILTER *);
  149. Install a stream filter
  150.  
  151. **********************************************************
  152. *  Simple stream filters                                 *
  153. **********************************************************
  154.  
  155. extern SFILTER    ucase_filt,
  156. Forces a stream to upper case
  157.  
  158. extern SFILTER    lcase_filt;
  159. Forces a stream to lower case
  160.  
  161. **********************************************************
  162. *  Stream encryption function                            *
  163. **********************************************************
  164.  
  165. int crypt_install(SFILE *, char *, int);
  166. Installs an encryption/decryption filter
  167.  
  168. **********************************************************
  169. *  Stream compression/expansion functions                *
  170. **********************************************************
  171.  
  172. int ncode_install(SFILE *);
  173. Installs an RLE encoder as a stream filter
  174.  
  175. int dcode_install(SFILE *);
  176. Installs an RLE decoder as a stream filter
  177.  
  178. **********************************************************
  179. *  File truncation functions                             *
  180. **********************************************************
  181.  
  182. int trunc(int, long);
  183. Truncate an open'ed file
  184.  
  185. int ftrunc(FILE *, long);
  186. Truncate an fopen'ed file
  187.  
  188. int truncate(char *, long);
  189. Truncate a named file
  190.  
  191. **********************************************************
  192. *  Filename parsing functions                            *
  193. **********************************************************
  194.  
  195. int fnsplit(char *,char *,char *,char *,char *,char *,char *);
  196. Split a string into drive/path/file/ext
  197.  
  198. char * fnmerge(char *,char *,char *,char *,char *,char *,char *);
  199. Merge drive/path/file/ext into a file string
  200.  
  201. int has_wild(char *);
  202. Checks a string for DOS wildcards
  203.  
  204. int wildname(char *, char *, int);
  205. Matches filenames against a pattern
  206.  
  207. **********************************************************
  208. *  Normalize file names                                  *
  209. **********************************************************
  210.  
  211. int flnorm(char *, char *);
  212. Normalize a filename
  213.  
  214. char * fln_fix(char *);
  215. Remove "dot" directories from pathnames
  216.  
  217. char * unix2dos(char *);
  218. Converts Unix-style paths to DOS-style
  219.  
  220. **********************************************************
  221. *  Open files using a path specification                 *
  222. **********************************************************
  223.  
  224. FILE * fopenp(char *, char *);
  225. fopen a file in the PATH
  226.  
  227. FILE * fopeng(char *, char *, char *);
  228. fopend/fopenp combination
  229.  
  230. FILE * fopend(char *, char *, char *);
  231. Fopen a file in an environment variable
  232.  
  233. int openp(char *, int);
  234. Open a file in the PATH
  235.  
  236. int opend(char *, int, char *);
  237. Open a file in the PATH
  238.  
  239. int openg(char *, int, char *);
  240. opend/openp combination
  241.  
  242. int getpath(char *);
  243. Retrieve the PATH variable and parse
  244.  
  245. **********************************************************
  246. *  File extension functions                              *
  247. **********************************************************
  248.  
  249. void badext(char *);
  250. Report invalid filename extension and exit
  251.  
  252. void newext(char *, char *, char *);
  253. Change a filename extension
  254.  
  255. int exttyp(char *, char *);
  256. Check a filename for a particular extension
  257.  
  258. **********************************************************
  259. *  Miscellaneous functions                               *
  260. **********************************************************
  261.  
  262. void eraok(char *);
  263. Ask permission before overwriting existing file
  264.  
  265. void cant(char *);
  266. Report inability to open a file and exit
  267.  
  268. void exit2dos(void);
  269. Permission to exit program
  270.  
  271. int repchar(char, int, FILE *);
  272. Repeat a character n times to fd
  273.  
  274. int iscons(FILE *);
  275. Is file descriptor the console
  276.  
  277.  
  278. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  279. *  MFLCONIO.H                                                          *
  280. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  281.  
  282.  
  283. **********************************************************
  284. *  Translate video attribute to ANSI.SYS command         *
  285. **********************************************************
  286.  
  287. char  *  make_ansi(int);
  288. Translate video attributes to ANSI strings
  289.  
  290. void     Bputs(char *);
  291. Write a string using BIOS only
  292.  
  293. **********************************************************
  294. *   Direct video package                                 *
  295. **********************************************************
  296.  
  297. void dvid_init(void);
  298. Initialize the direct video package
  299.  
  300. void dvid_bios(void);
  301. Use BIOS services rather than direct screen access
  302.  
  303. void dvid_sync(int);
  304. Avoid show on CGA monitors
  305.  
  306. void dvid_raw(int);
  307. Set control character translation mode
  308.  
  309. void dvid_done(void);
  310. Close the direct video package
  311.  
  312. void dvid_putchr(char);
  313. Place a character on the screen
  314.  
  315. void dvid_putstr(char *);
  316. Plase a string on the screen
  317.  
  318. void dvid_scroll(int, int, int, int, int, int);
  319. Scroll a region of the screen
  320.  
  321. void dvid_move(int, int);
  322. Move the direct video internal cursor
  323.  
  324. void dvid_setcount(int);
  325. Set repeat count for dvid_putchr()
  326.  
  327. void dvid_flush(void);
  328. Update the screen, merge the internal and PC cursors
  329.  
  330. void dvid_e2eol(void);
  331. Erase screen to end of line
  332.  
  333. void dvid_e2eos(void);
  334. Erase screen to end of screen
  335.  
  336. void dvid_attrib(int);
  337. Set direct video attribute (color)
  338.  
  339. void dvid_setpage(int, int);
  340. Set direct video page
  341.  
  342. void dvid_chgattrib(int, int, int, int, int);
  343. Change the attribute (color) for a region of the screen
  344.  
  345. void dvid_cls(void);
  346. Clear the display and home cursor
  347.  
  348. void dvid_clrfield(int, int, int);
  349. Clear a screen field
  350.  
  351. void dvid_say(int, int, char *);
  352. Display a string at specified position
  353.  
  354. void dvid_sayr(int, int, char *);
  355. Like dvid_say(), returns cursor to starting point
  356.  
  357. void dvid_enterfn(char *, int, int, int, int);
  358. Enter a filename from keyboard
  359.  
  360. void dvid_char_at(int, int, char);
  361. Display character at specified position
  362.  
  363. void dvid_char_atr(int, int, char);
  364. Like dvid_char_at(), returns cursor to start
  365.  
  366. void dvid_putsa(char *, int);
  367. Display a string with attribute
  368.  
  369. int dvid_printf(char *, ...);
  370. Write a formatted string to the screen
  371.  
  372. int dvid_printfa(int, char *, ...);
  373. Write a formatted string to the screen using specifed attrbiute
  374.  
  375. int dvid_getchr(int, int);
  376. Retrieve a character from the screen
  377.  
  378. int dvid_enterdata(char *, int, int, int, int);
  379. Enter a string of data from keyboard
  380.  
  381. int dvid_getattr(void);
  382. Gets the current screen attribute
  383.  
  384. int dvid_getraw(void)
  385. Gets the current control charatcer translation mode
  386.  
  387. **********************************************************
  388. *   Keyboard functions                                   *
  389. **********************************************************
  390.  
  391. void setcaps(void);
  392. Set the capslock status ON
  393.  
  394. void clrcaps(void);
  395. Sets Caps lock to OFF
  396.  
  397. void setnumlock(void);
  398. Sets numlock status ON
  399.  
  400. void clrnumlock(void);
  401. Sets numlock status OFF
  402.  
  403. int getkey(void);
  404. Extended keyboard fetch
  405.  
  406. int kbstatus(int);
  407. Returns specified keyboard status flag
  408.  
  409. int _kbstate(void);
  410. Returns keyboard status
  411.  
  412. **********************************************************
  413. *   Data entry functions functions                       *
  414. **********************************************************
  415.  
  416. void enterfn(char *, int, int, int, int);
  417. Enter a filename from keyboard
  418.  
  419. int enterdata(char *, int, int, int, int);
  420. Enter a string of data from keyboard
  421.  
  422. **********************************************************
  423. *   Console control and information functions            *
  424. **********************************************************
  425.  
  426. void viscroll(int, int, int, int, int, int, int);
  427. Scrolls the video display up or down
  428.  
  429. void vidpage(int);
  430. Set a video page as active page
  431.  
  432. void vid_border(int);
  433. Set border color
  434.  
  435. void vid_palette(int);
  436. Set color palette
  437.  
  438. void cursor_style(int, int, int);
  439. Alter the cursor style
  440.  
  441. void vmode(int);
  442. Set video mode
  443.  
  444. void v_init(void);
  445. Gets information on video system
  446.  
  447. int iscons(FILE *);
  448. Is file descriptor the console
  449.  
  450. int _stuff(void);
  451. Get equipment report (low level)
  452.  
  453. int stuff(int);
  454. Get equipment report (high level)
  455.  
  456. unsigned int getpos(int);
  457. Get current cursor position
  458.  
  459. **********************************************************
  460. *   Miscellaneous video functions                        *
  461. **********************************************************
  462.  
  463. void error(char *);
  464. Report a fatal error and exit
  465.  
  466. void cls(void);
  467. Clear screen and home cursor
  468.  
  469. void clrfield(int, int, int, int);
  470. Clear a screen field through BIOS
  471.  
  472. void d_cls(void);
  473. Clear current screen
  474.  
  475. void d_pos(int, int, int);
  476. Position the cursor on a video page
  477.  
  478. void d_say(int, int, char *);
  479. Display a string at a specific position
  480.  
  481. void d_saypag(int, int, char *, int);
  482. Display a string at a specific position with page specification
  483.  
  484. void mkbox(int, int, int, int, int);
  485. Make a box on the screen
  486.  
  487. void vid_wrpix(int, int, int);
  488. Write a pixel to the screen
  489.  
  490. int vid_rdpix(int, int);
  491. Read a pixel from the screen
  492.  
  493.  
  494. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  495. *  MFLOCALE.H                                                          *
  496. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  497.  
  498.  
  499. **********************************************************
  500. *  ANSI-compliant internationalization functions.        *
  501. **********************************************************
  502.  
  503. char *setlocale(int, const char *);
  504. Set a locale for a region
  505.  
  506. struct lconv localeconv(void);
  507. Retrieve the current active locale information
  508.  
  509.  
  510. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  511. *  MFLTIME.H                                                           *
  512. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  513.  
  514.  
  515. **********************************************************
  516. *  Microsecond accuracy timing operations.               *
  517. **********************************************************
  518.  
  519. uclock_t usec_difftime(start,finish)
  520. Calculate the difference between two times
  521.  
  522. uclock_t usec_clock(void);
  523. Read the system clock in microseconds
  524.  
  525. void restart_uclock(void);
  526. Re-initialize the microsecond clock
  527.  
  528. uclock_t usec_delay(uclock_t);
  529. Delay a given number of microseconds
  530.  
  531. LOGICAL usec_timeout(uclock_t, uclock_t, uclock_t);
  532. Test for a timeout condition
  533.  
  534. void msec_pause(long);
  535. Delay a given number of milliseconds
  536.  
  537. **********************************************************
  538. *  ANSI function to convert time to a string             *
  539. **********************************************************
  540.  
  541. size_t strftime(char *, size_t, const char *, const struct tm *);
  542. Convert data in tm structure to a string
  543.  
  544. **********************************************************
  545. *  Julian (scalar) date functions                        *
  546. **********************************************************
  547.  
  548. long ymd_to_julian (unsigned, unsigned, unsigned);
  549. Convert year, month, date to Julian date
  550.  
  551. void julian_to_ymd (long, unsigned *, unsigned *, unsigned *);
  552. Convert Julian date to year, month, date
  553.  
  554. int julian_to_wkday(long);
  555. Convert Julian date to day of the week
  556.  
  557. char * julian_to_dayname(long);
  558. Convert Julian date to day of the week
  559.  
  560. unsigned julian_to_yrday(long);
  561. Convert Julian date to day of the year
  562.  
  563. LOGICAL julian_to_time(long, time_t *);
  564. Convert Julian date to time_t value
  565.  
  566. LOGICAL julian_to_tm(long, struct tm *);
  567. Convert Julian date to tm structure
  568.  
  569. long time_to_julian(time_t);
  570. Convert time_t value to Julian date
  571.  
  572. long tm_to_julian(struct tm *);
  573. Convert tm structure to Julian date
  574.  
  575. **********************************************************
  576. *  Access file dates and time                            *
  577. **********************************************************
  578.  
  579. int getftime(int, struct ftime *);
  580. Get a file's time/date stamp
  581.  
  582. int setftime(int, struct ftime *);
  583. Set a file's time/date stamp
  584.  
  585. int touch(char *);
  586. Set file time/date stamp to the current time
  587.  
  588. void get_filetime(struct tm *, int);
  589. Get file date/time stamp
  590.  
  591. **********************************************************
  592. *  Misc time functions                                   *
  593. **********************************************************
  594.  
  595. void installtick(int *);
  596. Install timer interrupt service routine
  597.  
  598. void removetick(void);
  599. Remove timer interrupt service routine
  600.  
  601. void gtodsub(FILE *);
  602. Get time of day to file pointer
  603.  
  604. void gtodstr(char *);
  605. Get time of day to a string
  606.  
  607. int daynum(int, int, int);
  608. Find the number of a date within a year
  609.  
  610. int isleap(int);
  611. Check if year is a leap year
  612.  
  613. int weekday(int, int, int);
  614. Determine the day of the week form the date
  615.  
  616. char * monthis(int);
  617. Return a string pointer to name of month
  618.  
  619. char * wkdayname(int);
  620. Returns name of the day of the week
  621.  
  622.  
  623. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  624. * MFLSYS.H                                                              *
  625. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  626.  
  627.  
  628. **********************************************************
  629. *  Encryption/decryption                                 *
  630. **********************************************************
  631.  
  632. void crypt(char *);
  633. Encrypt/decrypt buffer data
  634.  
  635. LOGICAL cryptqual(char *, int);
  636. Qualify an encryption key
  637.  
  638. **********************************************************
  639. *  Serial communications functions                       *
  640. **********************************************************
  641.  
  642. void setport(int, int);
  643. Set port configuration
  644.  
  645. void setdtr(int, int);
  646. Set state of data terminal ready flag
  647.  
  648. void setrts(int, int);
  649. Set state of ready to send flag
  650.  
  651. void writechar(int, int);
  652. Send a char to the serial port
  653.  
  654. int readchar(int);
  655. Read a character from serial port
  656.  
  657. int ready_recv(int);
  658. Check for character availability
  659.  
  660. int ready_xmt(int);
  661. Check if port can accept a char to send
  662.  
  663. int chkdsr(int);
  664. Check state of data set ready flag
  665.  
  666. int chkdcd(int);
  667. Check state of carrier detect flag
  668.  
  669. int chkcts(int);
  670. Check state of clear to send flag
  671.  
  672. int chkring(int);
  673. Check state of ring indicator flag
  674.  
  675. int config_port(unsigned, int, int, int, int);
  676.  
  677. **********************************************************
  678. *  Printer functions                                     *
  679. **********************************************************
  680.  
  681. void pr_putline(char *);
  682. Print a string, and a cr/lf to the printer
  683.  
  684. void pr_puts(char *);
  685. Print a string to the printer
  686.  
  687. void pr_set(int);
  688. Set the number of the current printer
  689.  
  690. void pr_nl(void);
  691. Print a carriage return/line feed to printer
  692.  
  693. void pr_eject(void);
  694. Send a formfeed to the printer
  695.  
  696. void pr_carret(void);
  697. Send a carriage return to the printer
  698.  
  699. int blpr(char, int);
  700. Write a character to LPT? through BIOS 17H
  701.  
  702. int blprstat(int);
  703. Get LPT? status through BIOS 17H
  704.  
  705. int pr_putc(char);
  706. Send a character to the printer
  707.  
  708. **********************************************************
  709. *  Gameport functions                                    *
  710. **********************************************************
  711.  
  712. void init_game(unsigned char);
  713. Initialize and set game port mode
  714.  
  715. void clear_game(void);
  716. Clear pending input from game port
  717.  
  718. void debounce(void);
  719. Input debouncer
  720.  
  721. unsigned char get_press(void);
  722. Returns fully debounced key value
  723.  
  724. **********************************************************
  725. *  Error handling functions                              *
  726. **********************************************************
  727.  
  728. void aabort(int);
  729. Terminate a program using a common exit
  730.  
  731. void error(char *);
  732. Report a fatal error and exit
  733.  
  734. int ctlbrk();
  735. Control-break (^C) interrupt handler
  736.  
  737. **********************************************************
  738. *  Miscellaneous system functions                        *
  739. **********************************************************
  740.  
  741. void get_code_adr(unsigned int *, unsigned int *, unsigned int *);
  742. Get a function address
  743.  
  744. void get_data_adr(unsigned int *, unsigned int *, unsigned int *);
  745. Get a data item address
  746.  
  747. int _getdi(int);
  748. Get device information for file handle
  749.  
  750. int ibmtype(void);
  751. Find out type of computer
  752.  
  753. LOGICAL ansisys(void);
  754. Reports the availability of ANSI.SYS
  755.  
  756.  
  757. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  758. *  MFLSTRNG.H                                                          *
  759. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  760.  
  761.  
  762. char LAST_CHAR(char *);
  763. Returns last string character
  764.  
  765. char NEXT_TO_LAST_CHAR(char *);
  766. Returns penultimate string character
  767.  
  768. char STRING_TERMINATOR(char *);
  769. Returns terminating '\0'
  770.  
  771. LOGICAL STREQ(char *, char *);
  772. Compares strings TRUE/FALSE
  773.  
  774. LOGICAL STREQI(char *, char *);
  775. Compares strings TRUE/FALSE, UC/LC
  776.  
  777. int index(char *, char);
  778. Offset of leftmost char in a string
  779.  
  780. int rindex(char *, char);
  781. Offset of rightmost char in a string
  782.  
  783. **********************************************************
  784. *  BASIC-like string functions                           *
  785. **********************************************************
  786.  
  787. char * stralloc(int);
  788. Allocate a string from a string pool
  789.  
  790. char * left(char *, int);
  791. Return leftmost characters
  792.  
  793. char * right(char *, int);
  794. Return rightmost characters
  795.  
  796. char * mid(char *, int, int);
  797. Return embedded substring
  798.  
  799. char * string_add(char *, ...);
  800. BASIC-style string concatenation
  801.  
  802. int str_init(int, int);
  803. Initialize a string pool
  804.  
  805. void str_free(void);
  806. Free's the string pool
  807.  
  808. **********************************************************
  809. *  String translation functions                          *
  810. **********************************************************
  811.  
  812. int strxlat(char *, char *, char *);
  813. Translates characters based on tables
  814.  
  815. int strixlat(char *, char *, char *);
  816. Translates characters based on tables UC/LC
  817.  
  818. int strnxlat(char *, char *, char *, int);
  819. Translates first N characters based on tables
  820.  
  821. int strnixlat(char *, char *, char *, int);
  822. Translates first N characters based on tables UC/LC
  823.  
  824. **********************************************************
  825. *  Functions to remove unwanted characters               *
  826. **********************************************************
  827.  
  828. void strip(char *);
  829. Removes trailing newlines
  830.  
  831. void lv1ws(char *);
  832. Converts all multiple whitespace to single spaces
  833.  
  834. char * rmlead(char *);
  835. Removes leading whitespace
  836.  
  837. char * rmtrail(char *);
  838. Removes trailing whitespace
  839.  
  840. char * rmallws(char *);
  841. Removes all whitespace
  842.  
  843. **********************************************************
  844. *  Miscellaneous string functions                        *
  845. **********************************************************
  846.  
  847. void fillch(char *, char, int);
  848. Fill a string with a character
  849.  
  850. void loadstr(char *, char *, int);
  851. Load a string with padding
  852.  
  853. int argval(char *, int *, int);
  854. Convert an ASCII numerical string from an argument
  855.  
  856. int center(char *, int);
  857. Center a string
  858.  
  859. int dstr_i(char *, int*);
  860. Make an ASCII decimal string into an integer
  861.  
  862. int i_dstr(char *, int);
  863. Make an integer from a decimal ASCII string
  864.  
  865. unsigned int hstr_i(char *);
  866. Make an ASCII hexadecimal string into an integer
  867.  
  868.  
  869. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  870. * MFLMATH.H                                                             *
  871. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  872.  
  873.  
  874. **********************************************************
  875. *  CRC calculation functions                             *
  876. **********************************************************
  877.  
  878. unsigned crc16_clear(void);
  879. Clear a 16-bit crc value
  880.  
  881. unsigned crc16_update(unsigned, unsigned char);
  882. Update a 16-bit crc value
  883.  
  884. unsigned crc16_finish(unsigned);
  885. Finish a 16-bit crc calculation
  886.  
  887. unsigned long char crc32_clear(void);
  888. Clear a 32-bit crc value
  889.  
  890. unsigned long crc32_update(unsigned long, unsigned char);
  891. Update a 32-bit crc value
  892.  
  893. unsigned long crc32_finish(unsigned long);
  894. Finish a 32-bit crc calculation
  895.  
  896. **********************************************************
  897. *  Integer math functions                                *
  898. **********************************************************
  899.  
  900. int isqrt(unsigned);
  901. Extract integer square root of an int
  902.  
  903. int isqrtr(unsigned);
  904. Extract integer square root of an int w/ rounding
  905.  
  906. long lsqrt(unsigned long);
  907. Extract integer square root of a long
  908.  
  909. long lsqrtr(unsigned long);
  910. Extract integer square root of a long w/ rounding
  911.  
  912.  
  913. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  914. *  MFLDEFS.H                                                           *
  915. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  916.  
  917.  
  918. #define KB_flush()
  919. Empties keyboard buffer
  920.  
  921. #define Bputc(c)
  922. Write a character using BIOS only
  923.  
  924. #define BitSet(arg,posn)
  925. Set n'th bit
  926.  
  927. #define BitClr(arg,posn)
  928. Clear n'th bit
  929.  
  930. #define BitTst(arg,posn)
  931. Test n'th bit
  932.  
  933.  
  934. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  935. *  MFLSOUND.H                                                          *
  936. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  937.  
  938.  
  939. void mktone(int, int, int);
  940. Make a tone to the speaker (with music capability)
  941.  
  942. void soundon(void);
  943. Turn on the speaker
  944.  
  945. void soundoff(void);
  946. Turn off the speaker
  947.  
  948.